package net.oschina.app.pages;

import android.widget.FrameLayout;

import net.oschina.app.SoloWrap;

/**
 * Created by Aaron on 2017/3/5.
 */

public class PageCommon {
    private SoloWrap solo;
    FrameLayout homeFL,momentFL,exploreFL,myFL;

    public PageCommon(SoloWrap solo){
        this.solo = solo;
    }

    public void initViews(){
        solo.waitForText("还可以使用其他账号登录");
        homeFL = (FrameLayout) solo.getView("net.oschina.app:id/nav_item_news");
        momentFL = (FrameLayout)solo.getView("net.oschina.app:id/nav_item_tweet");
        exploreFL = (FrameLayout) solo.getView("net.oschina.app:id/nav_item_explore");
        myFL = (FrameLayout) solo.getView("net.oschina.app:id/nav_item_me");
    }

    public void goToHomeTab(){
        solo.clickOnView(homeFL);
    }

    public void goToMomentTab(){
        solo.clickOnView(momentFL);
    }

    public void goToExploreTab(){
        solo.clickOnView(exploreFL);
    }

    public void goToMyTab(){
        solo.clickOnView(myFL);
    }

}
